﻿
	<head>
		<meta charset="utf-8" />
		<title>立修</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		
		<style type="text/css">
	.str_wrap{
		
	
	font-size:12px;
	line-height:16px;
	position:relative;
	/*nowrap : 文本不会换行，文本会在在同一行上继续，直到遇到 <br> 标签为止。*/
	white-space:nowrap;
	}
	.str4 img { opacity:0.8}
	.str4 img:hover { opacity:1}
	.str4{
		background:#fff;
	}
	.str_move { 
	position:absolute; 
	top:0; 
	/*cursor:move;*/
}
</style>
	</head>

<body>

	<div class="am-form am-form-horizontal"  style="margin-top:30px;">
  							<div  class="am-form-group am-form-success am-form-icon am-form-feedback">
    							<label for="doc-ipt-3-a" class="am-u-sm-2 am-form-label" style="color:#0e90d2;">标题</label>
    							<div class="am-u-sm-10">
      								<input style="width:80%;border-color:#0e90d2;" type="text" name="title" id="title" class="am-form-field" placeholder="输入标题">     								
    							</div>
								<input type="hidden" name="accountId" value="${userInfo.accountId?c}" id="accountid">
    							<label style="margin-top:30px;color:#0e90d2;" for="doc-ipt-3-a" class="am-u-sm-2 am-form-label">内容</label>
    							<div class="am-u-sm-10" style="margin-top:30px;">
      								<textarea style="width:80%;border-color: #0e90d2;" name="content" class="" rows="5" id="content"></textarea>
      								
    							</div>

    							<div class="am-u-sm-10" style="margin-top:20px;">
    								<button style="float:right; margin-right:20%;" onclick="addArticle()" class="am-btn am-btn-primary">提交</button>
    							</div>
  							</div>
  							
						</div>

<script>
	function addArticle(){
		$.ajax({
			url:'${ctx}addArticle',
			method:'post',
			dataType:'json',
			data:{
				title:$('#title').val(),
				content:$('#content').val(),
				accountId:$('#accountid').val()
			},
			success:function(data){
				console.log("data"+data);
				//alert(data.code);
				if(data.code==0){
					alert("提交成功")
					$('.page-content').load("/community");
				}else{
					alert("提交失败")
				}

				
			}
			
		}); 

	}
</script>
</body>